<!--
Copyright © 2017, Che-Wei Hsu <cwxhsu@gmail.com>
This file is part of the MintCM.
Some rights reserved. See README.
-->

<html>

<head>

<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script language="javascript" type="text/javascript" src="jquery_main.js"></script>
<script language="javascript" type="text/javascript" src="jquery_form.js"></script>
<script language="javascript" type="text/javascript" src="mcm_jslib_api.js"></script>
<link rel="stylesheet" href="web_app_0901_style.css">

<script type="text/javascript">
function body_init()
{
    $("#show_box").html("");
}

function upload_file()
{
    var self_upload_jslib, rep_ret;


    if(($("#input_file_1").val() == "") &&
       ($("#input_file_2").val() == "") &&
       ($("#input_file_3").val() == ""))
    {
        alert("no select any file");
        return;
    }

    $("#show_box").html("");

    self_upload_jslib = new mcm_upload_jslib_t();
    self_upload_jslib.form_id_string = "form_upload";
    self_upload_jslib.other_query = "";
    rep_ret = mcm_jslib_upload(self_upload_jslib);
    if(rep_ret.rep_code < mcm_return_code.pass)
    {
        alert("call mcm_jslib_upload() fail" +
              "[" + rep_ret.rep_code + "]");
        mcm_jslib_run_script(rep_ret.rep_data);
        return;
    }
    mcm_jslib_run_script(rep_ret.rep_data);
}
</script>

</head>

<body onload="body_init()">

  <div>[multiple file input]</div>
  <div>[multiple other input]</div>

  <form id="form_upload">
    <input type="hidden" name="callback" value="upload_handle_01">
    <table class="css_table1">
      <tr>
        <td class="css_td1">file 1</td>
        <td class="css_td1">
          <input type="file" name="input_file_1" id="input_file_1" value="">
        </td>
      </tr>
      <tr>
        <td class="css_td1">addition text</td>
        <td class="css_td1">
          <input type="text" name="input_text_1" value=""><br>
          <input type="text" name="input_text_2" value="">
        </td>
      </tr>
      <tr>
        <td class="css_td1">file 2</td>
        <td class="css_td1">
          <input type="file" name="input_file_2" id="input_file_2" value="">
        </td>
      </tr>
      <tr>
        <td class="css_td1">addition radio</td>
        <td class="css_td1">
          <input type="radio" name="input_radio_1" value="big">big<br>
          <input type="radio" name="input_radio_1" value="little">little
        </td>
      </tr>
      <tr>
        <td class="css_td1">file 3</td>
        <td class="css_td1">
          <input type="file" name="input_file_3" id="input_file_3" value="">
        </td>
      </tr>
      <tr>
        <td class="css_td1">addition checkbox</td>
        <td class="css_td1">
          <input type="checkbox" name="input_checkbox_1" value="check totate">totate<br>
          <input type="checkbox" name="input_checkbox_2" value="check reverse">reverse
        </td>
      </tr>
    </table>
  </form>

  <button type="button" onclick="upload_file()">upload</button>
  <br>

  <div id="show_box"></div>

</body>

</html>
